package org.cable.shop.service;

import org.cable.common.enums.ProductOrderPayTypeEnum;
import org.cable.common.model.EventMessage;
import org.cable.common.util.JsonData;
import org.cable.shop.controller.request.ConfirmOrderRequest;

import java.util.Map;

/**
 * @author hsj
 * @date 2023/11/7 10:41
 */
public interface ProductOrderService {


    Map<String, Object> page(int page, int size, String state);

    /**
     * 查询订单状态
     * @param orderTraderNo
     * @return
     */
    String queryProductOrderState(String orderTraderNo);

    /**
     * 下单
     * @param orderRequest
     * @return
     */
    JsonData confirmOrder(ConfirmOrderRequest orderRequest);

    /**
     * 关闭订单
     * @param eventMessage
     */
    boolean closeProductOrder(EventMessage eventMessage);

    /**
     * 处理微信回调结果
     * @param wechatPay
     * @param paramMap
     */
    JsonData processOrderCallBackMsg(ProductOrderPayTypeEnum wechatPay, Map<String, String> paramMap);

    /**
     * 处理订单队列里面的订单相关消息
     * @param eventMessage
     */
    void handleProductOrderMessage(EventMessage eventMessage);

}
